#include "group_chat_item.h"
#include "ui_group_chat_item.h"

Group_chat_item::Group_chat_item(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Group_chat_item)
{
    ui->setupUi(this);
}

Group_chat_item::~Group_chat_item()
{
    delete ui;
}


void Group_chat_item::setGroupChatname(const QString &name)
{
    ui->label_groupaccount->setText(name);
    m_name=name;
}


void Group_chat_item::setGroupChatPixPic(const QPixmap &pic)
{
    ui->label_headphoto->setPixmap(pic.scaled(ui->label_headphoto->width(),ui->label_headphoto->height()));
    m_pix = pic;
}

void Group_chat_item::setAttr(int attr)
{
    //1代表群聊 0代表个人聊天
    m_group=attr;
}

int Group_chat_item::returnAttr()
{
    return  m_group;
}

void Group_chat_item::setIsRead(const QString &info)
{
    ui->label_2->setText(info);
    ui->label_2->setStyleSheet("QLabel { color : grey;"
                               "border: none;"
                               "background-color: transparent;}");
}

void Group_chat_item::setNotRead(const QString &info)
{
    ui->label_2->setText(info);
    ui->label_2->setStyleSheet("QLabel { color : red;"
                               "border: none;"
                               "background-color: transparent;}");
}

void Group_chat_item::setPower(int power)
{
    m_power = power;
}

void Group_chat_item::setNote(const QString &note)
{
    ui->note->setText(note);
}

int Group_chat_item::returnPower()
{
    return  m_power;
}

QString Group_chat_item::returnname()
{
    return m_name;
}

QString Group_chat_item::gstAccount()
{
    return ui->label_groupaccount->text();
}


